﻿Public Class frmTabReferenceMethod
    Dim editnode As EditXML = New EditXML()
    Dim initialDirect As String = ""

    Private Sub frmTabReferenceMethod_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Leave
        editXMLFile()
    End Sub
    Public Sub editXMLFile()
        editnode.Edit("/metadata/spdoinfo/indspref", txtIndirect.Text.Trim())
        editnode.Edit("/metadata/spdoinfo/direct", cboxDirect.SelectedItem)
        If initialDirect <> cboxDirect.SelectedItem() Then
            editnode.Remove("/metadata/spdoinfo", "rastinfo")
            editnode.Remove("/metadata/spdoinfo", "ptvctinf")
        End If
    End Sub
    Private Sub cboxDirect_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxDirect.SelectedIndexChanged
        If cboxDirect.SelectedItem = "Raster" Then
            frmMain.f32.Panel12.Visible = False
            frmMain.f32.lblVector.Visible = True
            frmMain.f33.Panel10.Visible = True
            frmMain.f33.lblRaster.Visible = False
        ElseIf cboxDirect.SelectedItem = "Point" Or cboxDirect.SelectedItem = "Vector" Then
            frmMain.f32.Panel12.Visible = True
            frmMain.f32.lblVector.Visible = False
            frmMain.f33.Panel10.Visible = False
            frmMain.f33.lblRaster.Visible = True
        Else
            frmMain.f32.Panel12.Visible = False
            frmMain.f32.lblVector.Visible = True
            frmMain.f33.Panel10.Visible = False
            frmMain.f33.lblRaster.Visible = True
        End If
    End Sub

    Private Sub frmTabReferenceMethod_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Enter
        initialDirect = cboxDirect.SelectedItem()
    End Sub

    Private Sub button_example_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_example.Click
        Dim helpForm As dialog_help = New dialog_help("ReferenceMethod")
        helpForm.ShowDialog()
    End Sub
End Class